import { Column, CreateDateColumn, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
import { DictionaryData } from "./dictionary_data.entity";

@Entity()
export class DictionaryType {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({
    comment:"字典名称",
  })
  name: string

  @Column({
    comment:"字典类型",
    unique: true
  })
  code: string

  @Column({
    comment: "字典备注描述",
    nullable: true
  })
  description: string

  @CreateDateColumn({
    comment:"创建时间"
  })
  createTime: Date

  @OneToMany(()=> DictionaryData, (data)=> data.dictionaryType)
  dictionaryData: DictionaryData[];
}